export type TaskStatus = '' | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 // 0: 未运行 1: 待运行 2: 运行中 3: 运行成功 4: 运行失败 5: 运行超时 '': 6: 数据准备中

export type TaskStatusItem = {
  status: TaskStatus
  name: string
  title: string
  isError: boolean
}

export const taskStatusList: TaskStatusItem[] = [
  {
    status: 0,
    name: '未运行',
    title: '未运行',
    isError: false
  },
  {
    status: 1,
    name: '待运行',
    title: '待运行',
    isError: false
  },
  {
    status: 2,
    name: '运行中',
    title: '运行中..',
    isError: false
  },
  {
    status: 3,
    name: '运行成功',
    title: '运行成功',
    isError: false
  },
  {
    status: 4,
    name: '运行失败',
    title: '运行失败',
    isError: true
  },
  {
    status: 5,
    name: '运行超时',
    title: '运行超时',
    isError: true
  },
  {
    status: 6,
    name: '数据准备中',
    title: '数据准备中..',
    isError: false
  },
  {
    status: 7,
    name: '已停止',
    title: '已停止',
    isError: true
  },
  {
    status: 8,
    name: '启动中',
    title: '启动中..',
    isError: false
  }
]

export const getTaskStatusItem = (status: TaskStatus): TaskStatusItem => {
  return taskStatusList.find(item => item.status === status)!
}

// 1：MSE-MAE 2：Top-K Accuracy 3：TPR@FPR 4：mAP 5：Precision-Recall-Hmean
export const normList = [
  {
    label: 'MSE-MAE',
    value: 1
  },
  {
    label: 'Top-K Accuracy',
    value: 2
  },
  {
    label: 'TPR@FPR',
    value: 3
  },
  {
    label: 'mAP',
    value: 4
  },
  {
    label: 'Precision-Recall-Hmean',
    value: 5
  },
  {
    label: '自定义',
    value: 6
  }
]
